package com.beiyou.dto;

import com.beiyou.dto.enums.EnumGoodsStatus;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author wzby
 * @Date: 2022/10/21 9:53
 */
@Data
public class GoodsDto {
    private Integer id;

    private String name;

    private String img;

    private Integer status = 1;

    private Integer parentId;

    private Integer seq;

    private String lastUpdateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime lastUpdateTime = LocalDateTime.now();

    private String statusX;

    public String getStatusX(){
        EnumGoodsStatus byCode = EnumGoodsStatus.findByCode(this.status);
        return byCode.getName();
    }
}
